home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / CandoV2.5_d1.adf / InstallCanDo < prev    next >
Text File  |  1993-10-07  |  15KB  |  571 lines

  1. ;*************************************************************************
  2. ;    Title:
  3. ;        Install-CanDo
  4. ;*************************************************************************
  5. ;    Description:
  6. ;        The Commodore Installer Script for CanDo 2.x Software
  7. ;*************************************************************************
  8. ;    Author:
  9. ;        Eddie Churchill, c/o INOVAtronics, Inc.
  10. ;*************************************************************************
  11. ;    Still to do:
  12. ;*************************************************************************
  13. ;    History:
  14. ;        22-Jul-1992
  15. ;            Now copying the helpfiles and unsnapshotting the icons
  16. ;        25-Jun-1992
  17. ;            Changed all around for 2.50
  18. ;        17:21:33 CST, 21 Jan 1992
  19. ;            Added resident cando.library checking
  20. ;        11:55:39 CST, 20 Jan 1992
  21. ;            Added DelOpt settings
  22. ;        13:44:22 CST, 15 Jan 1992
  23. ;            Preserve old cando.info file if one exists
  24. ;        18:15:15 CST, 02 Jan 1992
  25. ;            Made it actually ask for destination in novice mode
  26. ;        15:19:24 CST, 19 Dec 1991
  27. ;            Updated for Installer 1.9
  28. ;        14:39:07 CST, 16 Dec 1991
  29. ;            Finished
  30. ;        11:28:31 CST, 03 Dec 1991
  31. ;            Rewritting script for Installer 1.7
  32. ;*************************************************************************
  33.  
  34.  
  35. ;******************************************************
  36. ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
  37. ;******************************************************
  38.  
  39. ; some useful variables
  40.     (set true 1)
  41.     (set false 0)
  42.     (set on true)
  43.     (set off false)
  44.     (set yes true)
  45.     (set no false)
  46.     (set yep yes)
  47.     (set nope no)
  48.     (set is_a_file 1)
  49.     (set is_a_dir 2)
  50.     (set quote "\"")
  51.     (set newline "\n")
  52.     (set nothing "")
  53.     (set testing nope)
  54. ;    (set testing yep) ;<- uncomment this for testing mode
  55.     (set os2 (< 2293760 (getversion "exec.library" (resident)))) ; true if under 2.0
  56.     (set resident_candolib (getversion "cando.library" (resident)))
  57.     (set ntsc_mode false)
  58.     (set pal_mode true)
  59.     (set free-mem (+ (database "total-mem") 0)) ; leftover free ram
  60.  
  61. ; set up our delete options
  62.     (delopts "AskUser" "OkNoDelete" "Force")
  63.  
  64. ; determine the default system display mode
  65.     (if (= (database "vblank") "60")
  66.         (set display_mode ntsc_mode)
  67.         (set display_mode pal_mode)
  68.     )
  69.  
  70. ; some useful procedures
  71.     ; fills in the display_text string
  72.     (procedure get_display_text
  73.         (
  74.             (if (= display_mode ntsc_mode)
  75.                 (set display_text "NTSC")
  76.                 (set display_text "PAL")
  77.             )
  78.         )
  79.     )
  80.     
  81.     ; change userlevel to expert
  82.     (procedure expert_level
  83.         (
  84.             (user 2)
  85.         )
  86.     )
  87.     
  88.     ; change userlevel to novice
  89.     (procedure novice_level
  90.         (
  91.             (user 0)
  92.         )
  93.     )
  94.     
  95.     ; reset userlevel back to default
  96.     (procedure default_level
  97.         (
  98.             (user default-level)
  99.         )
  100.     )
  101.     
  102.     ; store off userlevel
  103.     (procedure save_default_level
  104.         (
  105.             (set default-level @user-level)
  106.         )
  107.     )
  108.  
  109. ; some overused strings
  110.     (set omp (cat "One moment please..." newline))
  111.     (set pci "Patching the copied icons.")
  112.  
  113. ; a general purpose global error trapper
  114.     (onerror
  115.         (makeassign "CanDoProgram_Master" (safe))
  116.         (makeassign "CanDoExtras_Master" (safe))
  117.         (makeassign "CanDoExamples_Master" (safe))
  118.     )
  119.  
  120.     
  121. ;****************************************
  122. ;***** FIGURE OUT WHERE STUFF GOES ******
  123. ;****************************************
  124.  
  125. ; now figure out the initial defaults for a bunch of things
  126.     (if (= testing true)
  127.         ( ; then clause
  128.             (set cando_dir "Ram:CanDo")
  129. ;            (set cando_dir nothing)
  130. ;            (set cando_dir (getassign "CanDo"))
  131.         )
  132.         ( ; else clause
  133.             ; @default-dest is already set for us
  134.             (set cando_dir (getassign "CanDo"))
  135.         )
  136.     )
  137.  
  138. ; introduce our selfs to the viewers
  139.     (welcome "Welcome to the CanDo 2.5x installer.  This installer uses "
  140.         "the Commodore Amiga Installer.  All of our future new products "
  141.         "will be using this installer and we would love to get any feedback "
  142.         "that might help in improving the installation procedure." newline newline
  143.     )
  144.  
  145. ; first reset the user level so that the novice can see whats going on
  146.     (save_default_level)
  147.     (expert_level)
  148.  
  149. ; see if we are doing an update
  150.     (if (<> cando_dir nothing)
  151.         (if (askbool
  152.                 (prompt "There seems to be a CanDo already installed in"
  153.                     " your drawer named " quote cando_dir quote ".  "
  154.                     "Do you want the update installed over it?")
  155.                 (help
  156.                     "The installer has determined that you may already have a "
  157.                     "copy of CanDo installed on your system. If this is wrong or "
  158.                     "you want the update installed elsewhere, select NO as an "
  159.                     "answer. Otherwise, select YES."
  160.                 )
  161.                 (default 1)
  162.             )
  163.             ( ; the then clause
  164.                 (set is_update true) ; hey, the user said yes
  165.             )
  166.             ( ; the else clause
  167.                 (set is_update false) ; hey, the user said nope
  168.                 (set cando_dir
  169.                     (askdir
  170.                         (prompt "Where would you like CanDo installed?")
  171.                         (help @askdir-help)
  172.                         (default @default-dest)
  173.                         (newpath)
  174.                     )
  175.                 )
  176.             )
  177.         )
  178.     )
  179.  
  180. ; if cando_dir is still nothing then where do they want it?
  181.     (if (= cando_dir nothing)
  182.         (set cando_dir
  183.             (askdir
  184.                 (prompt "Where would you like CanDo installed?")
  185.                 (help @askdir-help)
  186.                 (default @default-dest)
  187.                 (newpath)
  188.             )
  189.         )
  190.     )
  191.  
  192. ; before we go on lets reset the user's level back to what it was
  193.     (default_level)
  194.  
  195. ; verify that the cando directory exists
  196.     (if (<> (exists cando_dir) is_a_dir)
  197.         (makedir cando_dir
  198.             (prompt
  199.                 "The directory you have selected for CanDo does not "
  200.                 "seem to exist.  Do you want us to create it for you?"
  201.             )
  202.             (help @makedir-help)
  203.             (infos)
  204.             (confirm)
  205.         )
  206.     )
  207.  
  208.  
  209. ;***********************************
  210. ;***** GET FIRST DISK IN HERE ******
  211. ;***********************************
  212.  
  213. ; ask for the first disk, it should be here but lets check anyway
  214.     (askdisk
  215.         (prompt    "Please insert the disk labeled \"CanDo Program\".")
  216.         (help    "The CanDo Program disk contains the main CanDo program"
  217.                 "and some support programs and utilities"
  218.         )
  219.         (dest  "CanDo")
  220.         (newname "CanDoProgram_Master")
  221.     )
  222.  
  223. ; tell the user of our progress
  224.     (complete 5)
  225.  
  226.  
  227. ;************************************
  228. ;***** FIGURE OUT DISPLAY MODE ******
  229. ;************************************
  230.  
  231. ; tell the user about it
  232.     (working omp "Checking to see what type of Display this system uses.")
  233.     
  234. ; make sure the display_text is filled in
  235.     (get_display_text)
  236.     
  237. ; ask the expert user what mode to use
  238.     (set display_mode
  239.         (askchoice
  240.             (prompt "You are currently using a " display_text " system.  "
  241.                 "Which display system do you want CanDo configured for?"
  242.             )
  243.             (help "This should be initially set to the correct display system "
  244.                 "according to your Amiga.  If you want, you can override this.  "
  245.                 "NTSC is normally only useful in the Americas (USA, Canada, "
  246.                 " Mexico, etc.) whereas PAL is used everywhere else." newline
  247.                 "All this really does is choose which basedeck CanDo should "
  248.                 "default to.  NTSC's basedeck's window is 320 by 200 and PAL's "
  249.                 "is 320 by 256."
  250.                 newline newline
  251.                 @askchoice-help
  252.             )
  253.             (choices "NTSC Display (200/400 pixels high)" "PAL Display (256/512 pixels high)")
  254.             (default display_mode)
  255.         )
  256.     )
  257.  
  258. ; figure out the correct text string
  259.     (get_display_text)
  260.     
  261. ; tell the user of our progress
  262.     (complete 10)
  263.  
  264.     (novice_level)
  265.     
  266. ; first clean up the cando directory
  267.     (if (= (exists (tackon cando_dir "CanDoFiles")) is_a_dir)
  268.         (
  269.             (working omp "Cleaning up the CanDo directory.")
  270.     
  271.             (set temp (cat "Cd " cando_dir "\nDelete (CanDoFiles|Helpfiles|ObjectTools|EditorTools|XtraTools|CLIUtilities) All Quiet"))
  272.             (run temp)
  273.         )
  274.     )
  275.     
  276. ;****************************************
  277. ;***** COPY OVER FIRST DISK'S STUFF *****
  278. ;****************************************
  279.  
  280. ; first copy over the c: stuff
  281.     (set c_dir
  282.         (copyfiles
  283.             (prompt "Copying C: files needed by CanDo")
  284.             (help "This will copy " quote "DeckRunner" quote " and " quote
  285.                 "DeckBinder" quote " to your system's C directory." newline
  286.                 newline
  287.                 @copyfiles-help
  288.             )
  289.             (source "CanDoProgram_Master:C")
  290.             (dest "C:")
  291.             (pattern "Deck#?")
  292.             (files)
  293.         )
  294.     )
  295.     
  296. ; look for c:deckrunner
  297.     (set deck_tool (tackon c_dir "DeckRunner"))
  298.     (if (<> (exists deck_tool) is_a_file)
  299.         (set deck_tool "DeckRunner")
  300.     )
  301.  
  302. ; look for c:deckbinder
  303.     (set bind_tool (tackon c_dir "DeckBinder"))
  304.     (if (<> (exists bind_tool) is_a_file)
  305.         (set bind_tool "DeckBinder")
  306.     )
  307.  
  308. ; tell the user of our progress
  309.     (complete 15)
  310.  
  311. ; first copy over the libs: stuff
  312.     (working omp "Scanning to see which libraries are on this distribution disk.")
  313.     
  314.     (copylib
  315.         (prompt "Copying/Updating CanDo.Library")
  316.         (source "CanDoProgram_Master:Libs/CanDo.Library")
  317.         (dest "Libs:")
  318.     )
  319.     
  320.     (copylib
  321.         (prompt "Copying/Updating InovaMusic.Library")
  322.         (source "CanDoProgram_Master:Libs/InovaMusic.Library")
  323.         (dest "Libs:")
  324.     )
  325.     
  326. ; tell the user of our progress
  327.     (complete 20)
  328.  
  329.     (copylib
  330.         (prompt "Copying/Updating ASL.Library")
  331.         (source "CanDoProgram_Master:Libs/ASL.Library")
  332.         (dest "Libs:")
  333.     )
  334.     
  335.     (copylib
  336.         (prompt "Copying/Updating AmigaGUIDE.Library")
  337.         (source "CanDoProgram_Master:Libs/AmigaGUIDE.Library")
  338.         (dest "Libs:")
  339.     )
  340.     
  341.     
  342. ; tell the user of our progress
  343.     (complete 25)
  344.  
  345. ; preserving old cando info if it exists
  346.     (set temp (tackon cando_dir "CanDo.info"))
  347.     (if (= (exists temp) is_a_file)
  348.         (
  349.             (working omp "Preserving your old CanDo info file.")
  350.             (rename temp (tackon cando_dir "CanDo_Old.info"))
  351.         )
  352.     )
  353.     
  354. ; Copy over the cando program itself
  355.     (working omp "Scanning for the CanDo program and readme files.")
  356.     
  357.     (set cando_dir
  358.         (copyfiles
  359.             (prompt "Copying CanDo program and readme files")
  360.             (source "CanDoProgram_Master:CanDoStuff")
  361.             (dest cando_dir)
  362.             (pattern "#?")
  363.             (files)
  364.             (infos)
  365.         )
  366.     )
  367.     
  368. ; tell the user of our progress
  369.     (complete 30)
  370.  
  371. ; Copy over the cando program itself
  372.     (working omp "Copying CanDo's HelpFiles")
  373.     
  374.     (set cando_dir
  375.         (copyfiles
  376.             (prompt "Copying CanDo's HelpFiles")
  377.             (source "CanDoProgram_Master:")
  378.             (dest cando_dir)
  379.             (pattern "HelpFiles")
  380.             (infos)
  381.         )
  382.     )
  383.     
  384.     (set reader_tool "More")
  385.     
  386. ; tell the user of our progress
  387.     (complete 35)
  388.  
  389. ;************************************
  390. ;***** GET SECOND DISK IN HERE ******
  391. ;************************************
  392.  
  393. ; ask for the second disk.
  394.     (askdisk
  395.         (prompt    "Please insert the disk labeled \"CanDo Extras\".")
  396.         (help    "The CanDo Extras disk contains various overlays and "
  397.             "support files for the CanDo program."
  398.         )
  399.         (dest  "CanDoExtras")
  400.         (newname "CanDoExtras_Master")
  401.     )
  402.  
  403. ; tell the user of our progress
  404.     (complete 50)
  405.  
  406.  
  407. ;*****************************************
  408. ;***** COPY OVER SECOND DISK'S STUFF *****
  409. ;*****************************************
  410.  
  411. ; copy over cando's files and overlays
  412.     (working omp "Scanning for CanDo's data files and overlays.")
  413.     
  414. ; due to a bug and because we want to still test we do this
  415.     (copyfiles
  416.         (prompt "Copying CanDo's Extras disk.")
  417.         (source "CanDoExtras_Master:CanDoStuff")
  418.         (dest cando_dir)
  419.         (pattern "#?")
  420.         (infos)
  421.     )
  422.     
  423. ; tell the user of our progress
  424.     (complete 55)
  425.  
  426. ; since the cando is setup for ntsc we only need to this for pal mode
  427.     (if (= display_mode pal_mode)
  428.         (
  429.             ; make up the tempory directory name
  430.             (set temp_dir (tackon cando_dir "CanDoFiles/Overlays"))
  431.             
  432.             ; rename current (NTSC) base deck to basedeck.ntsc
  433.             (rename
  434.                 (tackon temp_dir "BaseDeck")
  435.                 (tackon temp_dir "BaseDeck.NTSC")
  436.             )
  437.             
  438.             ; rename basedeck.pal to basedeck
  439.             (rename
  440.                 (tackon temp_dir "BaseDeck.PAL")
  441.                 (tackon temp_dir "BaseDeck")
  442.             )
  443.         )
  444.     )
  445.             
  446. ; tell the user of our progress
  447.     (complete 70)
  448.  
  449.  
  450. ;************************************
  451. ;***** GET THIRD DISK IN HERE ******
  452. ;************************************
  453.  
  454. ; ask for the third disk.
  455.     (askdisk
  456.         (prompt    "Please insert the disk labeled \"CanDo Examples and Utilities\".")
  457.         (help    "The CanDo Examples and Utilities disk contains various utilities and "
  458.             "example decks for your use."
  459.         )
  460.         (dest  "CanDoExamples")
  461.         (newname "CanDoExamples_Master")
  462.     )
  463.  
  464. ; tell the user of our progress
  465.     (complete 75)
  466.  
  467.  
  468. ;****************************************
  469. ;***** COPY OVER THIRD DISK'S STUFF *****
  470. ;****************************************
  471.  
  472. ; copy cando example disk's decks, cliutilities and utilities stuff
  473.     (working omp "Scanning for CanDo's utilities and example decks.")
  474.     
  475. ; due to a bug and because we want to still test we do this
  476.     (copyfiles
  477.         (prompt "Copying CanDo's Examples disk.")
  478.         (source "CanDoExamples_Master:CanDoStuff")
  479.         (dest cando_dir)
  480.         (pattern "#?")
  481.         (infos)
  482.     )
  483.  
  484. ; cleaning the icons in the directory
  485.     (working omp "Cleaning up the copied icons")
  486.     
  487. ; here we go...
  488.     (foreach cando_dir "#?"
  489.         (
  490.             (set temp (tackon cando_dir @each-name))
  491.             (if (= (exists (cat temp ".info")) is_a_file)
  492.                 (tooltype
  493.                     (dest temp)
  494.                     (noposition)
  495.                 )
  496.             )
  497.         )
  498.     )
  499.     
  500. ; modify S:User-Startup
  501.     (working omp "Updating S:User-Startup.")
  502.     
  503.     (startup "CanDo"
  504.         (prompt
  505.             "Some instructions need to be added to the \"S:User-Startup\" "
  506.             "so that your system will be properly configured to use CanDo.")
  507.         (help @startup-help)
  508.         (command
  509.             "ASSIGN CanDo: " quote cando_dir quote newline
  510.             "ASSIGN CanDoExtras: " quote cando_dir quote newline
  511.             "ASSIGN CanDoExamples: " quote cando_dir quote newline
  512.         )
  513.     )
  514.  
  515. ; tell the user of our progress
  516.     (complete 100)
  517.  
  518.  
  519. ;*****************************
  520. ;***** WE BE ALMOST DONE *****
  521. ;*****************************
  522.  
  523. ; make sure that default-dir is pointing to the right place
  524.     (set @default-dest cando_dir)
  525.  
  526. ; some debug stuff
  527.     (if testing
  528.         (
  529.             (debug (cat "cando_dir     = " quote cando_dir quote))
  530.             (debug (cat "c_dir         = " quote c_dir quote))
  531.             (debug (cat "libs_dir      = " quote libs_dir quote))
  532.             (debug (cat "deck_tool     = " quote deck_tool quote))
  533.             (debug (cat "bind_tool     = " quote bind_tool quote))
  534.             (debug (cat "browse_tool   = " quote browse_tool quote))
  535.             (debug (cat "killdeck_tool = " quote killdeck_tool quote))
  536.             (debug (cat "cando_tool    = " quote cando_tool quote))
  537.             (debug (cat "reader_tool   = " quote reader_tool quote))
  538.             (debug (cat "stuff_dir     = " quote stuff_dir quote))
  539.             (debug (cat "mostuff_dir   = " quote mostuff_dir quote))
  540.             (debug (cat "decks_dir     = " quote decks_dir quote))
  541.         )
  542.     )
  543.  
  544. ; unmake those three assignments
  545.     (makeassign "CanDoProgram_Master" (safe))
  546.     (makeassign "CanDoExtras_Master" (safe))
  547.     (makeassign "CanDoExamples_Master" (safe))
  548.  
  549. ; final message for our viewers
  550.     ; well either way we want to say this
  551.     (set end_text "Well thats it folks, have a fun time with CanDo v2.5x.") ; altspace in name
  552.     
  553.     ; if the system has a library loaded then ask user to reset their machine
  554.     (if (> resident_candolib 0)
  555.         (set end_text
  556.             (cat
  557.                 "!! REBOOT YOUR MACHINE BEFORE USING CANDO !!"
  558.                 newline
  559.                 newline
  560.                 "This machine has an old version of CanDo.library in memory.  "
  561.                 "In order to flush the library you should reboot your machine."
  562.                 newline
  563.                 newline
  564.                 end_text
  565.             )
  566.         )
  567.     )
  568.     
  569.     ; now for the real exit
  570.     (exit end_text)
  571.